package main

import (
	"fmt"
	"gin-easy/models"
	"gin-easy/pkg/es"
	"gin-easy/pkg/rabbitmq"
	"gin-easy/pkg/redis_client"
	"gin-easy/pkg/validator"
	"gin-easy/pkg/viper_config"
	"gin-easy/pkg/zap_log"
)

func init() {
	viper_config.Setup()
	models.Setup()
	zap_log.Setup()
	redis_client.Setup()
	validator.Setup()
	es.Setup()
	rabbitmq.Setup()
}
func main() {
	r := RouteInit()
	defer rabbitmq.Rabbitmq.Close() //注意close必须放在main里面
	defer rabbitmq.RabbitmqCh.Close()
	addrs := fmt.Sprintf("0.0.0.0%s", viper_config.Conf.Port)
	r.Run(addrs)
}
